<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>创建BFC的区域，它的自动高度需要计算浮动元素</title>
	<style>
		.container{
			background: black;
			/*创建BFC区域*/
			/*position:absolute;
			overflow: hidden; 副作用最小
			float: left;*/

		}

		.item{
			width: 200px;
			height: 200px;
			margin: 20px;
			background: red;
			float: left;
		}

		.clearfix::after{
			content: "";
			display: block;
			clear: both;
		}


	</style>
</head>
<body>
	<div class="container clearfix">
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
		<div class="item"></div>
	</div>
</body>
</html>